var amapMapCom = Vue.extend({  //高德地图

    data: function() {
        let center = [113.266486, 23.374121];
        return {
          amapManager,
          zoom: 14,
          lang: "zh_cn", //可选值：en，zh_en, zh_cn
          center,
          window: {
            position: center,
            content: '<h4>13411173567<h4>'
          },
          events: {
            init: (o) => {
              console.log(o.getCenter())
              console.log(this.$refs.map.$$getInstance())
              o.getCity(result => {
                console.log(result)
                this.currentLocationText = result.province+result.city+result.district;
              })
            },
            'moveend': () => {
            },
            'zoomchange': () => {
            },
            'click': (e) => {
              alert('map clicked');
            }
          },
          plugin: ['ToolBar', {
            pName: 'MapType',
            defaultType: 0,
            events: {
              init(o) {
                console.log(o);
              }
            }
          }],
          currentLocationText:'未知当前位置！' //当前位置
        };
      },
      created() {
      },
      mounted: function() {
        this.$nextTick(function() {//this.TouchSlide();
            //this.currentLocation();
        });
      },
      methods: {
        getMap() {
          // amap vue component
          console.log(amapManager._componentMap);
          // gaode map instance
          console.log(amapManager._map);
        },
      },

    template: '\
    <div class="amap-page-container">\
        <div>当前位置：<span v-text="currentLocationText"></span></div>\
        <el-amap vid="amapDemo" :center="center" :zoom="zoom" :lang="lang" class="amap-demo" ref="map" :amap-manager="amapManager" :plugin="plugin" :events="events">\
            <el-amap-info-window :position="window.position" :content="window.content"></el-amap-info-window>\
        </el-amap>\
    </div>\
',


});